<include file="Layouts:header"/><!-- BEGIN BODY -->
<body class="page-header-fixed">
<!-- BEGIN HEADER -->
<div class="header navbar navbar-inverse navbar-fixed-top">
    <include file="Layouts:navigator"/>
</div>
<!-- END HEADER --><!-- BEGIN CONTAINER -->
<div class="page-container row-fluid">
    <include file="Layouts:slider"/>
    <!-- BEGIN PAGE -->
    <div class="page-content">
        <include file="Layouts:bread_crumb"/>
        <div class="container-fluid mb-container" style="background-color: #fff;">
            <div class="tab-content">
                <div class="tab-pane  active">
                    <div class="portlet box">
                        <div class="portlet-body">
                            <?php
                            //if ($isIt == true) {
                            ?>
                            <button id="addEcsBtn" type="button" class="btn blue">
                                添加ECS服务器
                            </button>
                            <?php
                            //}
                            ?>
                            <div id="sample_2_wrapper" class="dataTables_wrapper form-inline">
                                <table class="table table-striped table-bordered table-hover table-full-width dataTable" width="100%">
                                    <thead>
                                        <tr>
                                            <th width="8%" style="padding:10px;">编号</th>
                                            <th width="8%" style="padding:10px;">主机名</th>
                                            <th width="8%" style="padding:10px;">内网IP</th>
                                            <th width="8%" style="padding:10px;">外网IP</th>
                                            <th width="8%" style="padding:10px;">配置</th>
                                            <th width="8%" style="padding:10px;">位置</th>
                                            <th width="8%" style="padding:10px;">环境分级</th>
                                            <th width="8%" style="padding:10px;">操作系统</th>
                                            <th width="8%" style="padding:10px;">SSH端口</th>
                                            <th width="8%" style="padding:10px;">主要用途</th>
                                            <th width="8%" style="padding:10px;">主要使用者</th>
                                            <th width="8%" style="padding:10px;">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php
                                        foreach ($ecsList as $ecsId => $ecsItem) {
                                        ?>
                                        <tr>
                                            <td><?php echo $ecsItem['info']['id'] ?></td>
                                            <td><?php echo $ecsItem['info']['hostname'] ?></td>
                                            <td><?php echo $ecsItem['info']['eth0'] ?></td>
                                            <td><?php echo $ecsItem['info']['eth1'] ?></td>
                                            <td><?php echo $ecsItem['info']['configuration'] ?></td>
                                            <td><?php echo $ecsItem['info']['position'] ?></td>
                                            <td><?php echo $ecsItem['info']['env_type'] ?></td>
                                            <td><?php echo $ecsItem['info']['os'] ?></td>
                                            <td><?php echo $ecsItem['info']['ssh_port'] ?></td>
                                            <td><?php echo $ecsItem['info']['extend_desc'] ?></td>
                                            <td><?php echo implode(',', $ecsItem['users']) ?></td>
                                            <td>
                                                <a href="/home/it/ecs_detail?id=<?php echo $ecsItem['info']['id'] ?>" class="btn mini purple editBtn"><i class="icon-edit"></i> 查看详情</a>
                                                <br />
                                                <br />
                                                <a href="###" class="btn mini blue editEcsBtn"><i class="icon-edit"></i> 编辑</a>
                                            </td>
                                        </tr>
                                        <?php
                                        }
                                        ?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- loading start -->
        <div id="loadingBox"
             style="display:none;position: fixed; left: 50%; top: 50%; width: 150px; height: 150px; margin-left: -75px; margin-top: -75px;">
            <img src="/Public/frontapp/media/image/loading-spinner.gif"/>
        </div>
        <!-- loading end -->
        <!-- mask start -->
        <div id="mask" class="modal-backdrop" style="display:none;">
        </div>
        <!-- mask end -->
        <include file="Layouts:add_issue_window"/>
        <include file="Layouts:add_ecs_window"/>
    </div>
    <include file="Layouts:foot_page"/>
    <script type="text/javascript" src="/Public/frontapp/sea.js">
    </script>
    <script type="text/javascript" src="/Public/frontapp/config/config.js">
    </script>
    <script type="text/javascript" src="/Public/frontapp/lib/seajs-text.js">
    </script>
    <script type="text/javascript">
        seajs.use("/Public/frontapp/src/code/ecs.js?v20151110");
    </script>
</body>
<!-- END BODY -->
</html>
